using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace ZuDoKu.Utilities
{
    public static class GamePadHelper
    {
        /// <summary>
        /// If you use a binary | to specify multiple players this will seperate them out again.
        /// </summary>
        /// <param name="players"></param>
        /// <returns></returns>
        public static PlayerIndex[] GetAllPlayers(PlayerIndex players)
        {
            List<PlayerIndex> p = new List<PlayerIndex>();
            foreach (PlayerIndex index in GetAllPlayers())
            {
                if ((players & index) == index)
                {
                    p.Add(index);
                }
            }
            return p.ToArray();
        }

        public static PlayerIndex[] GetAllPlayers()
        {
            return new PlayerIndex[] { PlayerIndex.One, PlayerIndex.Two, PlayerIndex.Three, PlayerIndex.Four };
        }
    }
}
